/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Database;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import oracle.jdbc.pool.OracleDataSource;

/**
 *
 * @author owner
 */
public class Koneksi {
    public static Connection open() {
        String jdbcUrl="jdbc:oracle:thin:@localhost:1521:XE";
        String name="HR";
        String pass="suryo115314";
        Connection conn = null;
        
        try {
            OracleDataSource ds = new OracleDataSource();
            ds.setURL(jdbcUrl);
            conn = ds.getConnection(name, pass);
            Statement stat = conn.createStatement();
            System.out.println("Koneksi berhasil");

        } catch (SQLException ex) {
            System.out.println("Koneksi gagal");
        }
        return conn;
    }
}